Target Parameterization for Presentations
Presentations may be parameterized through targets. To parameterize a presentation, start by adding a Target, then create an interaction between the target and the relevant visualization.
Direct URL Loading
Parameterize the presentation's URL for direct content loading, using the following syntax:
{YourPyramidsite}/direct/?id={content identifier} &target[Target Name]=[Dimension].[Hierarchy].[Member]:[Dimension].[Hierarchy].[Member]
Example:
{YourPyramidsite}/direct/?id={content identifier} &target[Target Name]=[customers].[Country].[France]:[customers].[country].[Germany]
Embedded Content
Use JavaScript to parameterize an embedded presentation:
var target = { name: 'Target 1', filters: [ { value: '[customers].[country].[France]' }, { value: '[customers].[country].[Germany]' }, ], olap: false } var params = { targets: [target] }
Example:
//embed the presentation in the container var countryFilter = { value: '[customers].[country].[France]' }; var target = { name: 'Target 1', filters: [countryFilter], olap: false }; pyramid.embed(document.getElementById(‘myDiv’)), { id: "f8d66c64-893b-43fc-8049-e9b710ec90f9", host: "https://mysite", contentType: "storyboard", params: { targets: [target] } });
Parameterization Syntax Examples
The syntax of the URL is as follows:
{YourPyramidsite}/direct/?id={content identifier}&target[Target Name]=[Dimension].[Hierarchy].[Member]:[Dimension].[Hierarchy].[Member]
The example below will filter the target visuals in the presentation according to the target called 'Country', by the member elements 'France' and Germany':
https://g2.pyramdanalytics.com/direct/?id=direct?id=134fd567-d6e3-4b8e-9484-b720d4e39a17&target[Country]=[customers].[Country].[France]:[customers].[country].[Germany]
Cube and BW Targets
If you are parameterizing a target that is interacting with a visual from an MS OLAP, Tabular, or BW data source, you need to add the appropriate flag to the URL after the target's name.
For OLAP or Tabular models, add the flag ":MS"; for BW models, add the flag ":BW".
MS OLAP/ Tabular
If the target connects to a visual from a cube model, add ":MS" after the target's name: "&target[Target1:MS]="
https://g2.pyramdanalytics.com/direct/?id=direct?id=134fd567-d6e3-4b8e-9484-b720d4e39a17&target[Target1:MS]=[customers].[Country].[France]
SAP BW
If the target connects to a visual from a BW model, add ":BW" after the target's name: "&target[Target1:BW]="
https://g2.pyramdanalytics.com/direct/?id=direct?id=134fd567-d6e3-4b8e-9484-b720d4e39a17&target[Target1:BW]=[customers].[Country].[France]
Multiple Targets
A separate target is required for each hierarchy that will be used to filter the target visual. However, multiple member elements can be used as a filter for each target, as long as each member element belongs to the same hierarchy.
In the example below, the target visual will be filtered by 2 targets: Product Category and Manufacturer. The target called 'Product Category' will be used to filter by the 'Bikes' element (from the Product Category hierarchy), while the target called 'Manufacturer' will be used to filter by the 'Acme' element (from the Manufacturer hierarchy).
https://g2.pyramdanalytics.com/direct/?id=direct?id=134fd567-d6e3-4b8e-9484-b720d4e39a17&target[Product Category]=[products].[Product Category].[Bikes]&target[Manufacturer]=[manufacturers].[Manufacturer].[Acme]
Here, an interaction was added from the grid on Slide 1 to the target called 'Product Category':
Next, an interaction was added from the target to the map on Slide 2:
The following URL was entered, filtering the visual by the elements Bikes and Clothing (blue highlight below):
https://g2.pyramdanalytics.com/direct/?id=direct?id=134fd567-d6e3-4b8e-9484-b720d4e39a17&target[Target1]=[products].[Product Category].[Bikes]:[products].[Product Category].[Clothing]
Here, 2 targets were added: Product Category and Manufacturer. An interaction was added from the grid on Slide 1 to each of the targets:
Next, an interaction was added from each target to the map on Slide 2:
The following URL was entered, filtering the visual by the elements the 'Acme' element from the Manufacturer hierarchy, and the 'Bikes' element from the Product Category hierarchy:
https://g2.pyramdanalytics.com/direct/?id=direct?id=134fd567-d6e3-4b8e-9484-b720d4e39a17&target[Product Category]=[products].[Product Category].[Bikes]&target[Manufacturer]=[manufacturers].[Manufacturer].[Acme]